{/include file=$this->header_file /}
<!-- 以上顶部信息不要改-->
<link rel="stylesheet" type="text/css" href="/css/acl.css" />
<div id="acl">
{/include file=$this->location_file /}

{/if $do_type == 'no'/}
<table width="80%" border="1" align="center">
  <tr>
    <td colspan="5" align="center"><a href="/acladmin/group/do_type/add">新增用户组</a></td>
  </tr>
  <tr>
    <th colspan="2">用户组</th>
    <th colspan="3">操作</th>
  </tr>
   {/section name=key1 loop=$result/}
  <tr onmouseover="this.style.background='#FFFF66'" onmouseout="this.style.background=''">
    <td width="20%">{/$result[key1].oug_zh_name/}</td>
    <td width="20%">{/$result[key1].oug_en_name/}</td>
    <td width="20%"><a href="/acladmin/group/do_type/up/key/{/$result[key1].oug_id/}">权限设置</a> </td>
    <td width="20%"><a href="/acladmin/index/s/{/$result[key1].oug_en_name/}/f/2">用户管理</a></td>
    <td width="20%"><a  href="#"onclick="javascript:if  (confirm('确定要删除整个={/$result[key1].oug_zh_name/}=吗?')) href='/acladmin/group/do_type/del/key/{/$result[key1].oug_id/}';else  return;">删除</a></td>
  </tr>
  {//section/}
</table>
{//if/}
{/if $do_type == 'add'/}
<Script   language="JavaScript">   
     //验证表单
      function   check_add()   
      {       
       if   (form1.info_zh.value == "")   
          {   
              alert("请输入中文描述!");   
              form1.info_zh.focus();   
              return   (false);   
          } 
		  
	   if   ( form1.info_en.value == "")   
          {   
              alert("请输入英文描述!");   
              form1.info_en.focus();   
              return   (false);   
          } 
      }  
	   /*假使一组资源有下属操作被选中,该资源就被自动选中*/
	   function check_check(list_name,number){
	      //alert(list_name);alert(number);
		  var result = 0;
		  result = result -0;
		  for (i=1;i<=number;i++){
		      if (document.getElementById(list_name+'_'+i).checked == true){
			      result = result + 1;
			  }
		  }
		  if (result == 0){
		      document.getElementById(list_name).checked = false;
		  }else{
		       document.getElementById(list_name).checked = true;
		  }
	   }
	   
	   /*点击选中资源时,其下操作全选*/
	   function check(name){
	       num = document.getElementById(name+'_check_number').value - 0;
		   if (document.getElementById(name).checked == true){
		       do_do = true;
		   }else{
		       do_do =false;
		   }
		   
		   for (j=1;j<=num;j++){
			       document.getElementById(name+'_'+j).checked = do_do;
			}
	   }
  </Script>
 <form id="form1" name="form1" method="post" action="/acladmin/group/do_type/add" onsubmit="return check_add();">
<table width="80%" border="1" align="center">
  <tr>
    <th>新增用户组 &nbsp;&nbsp;&nbsp;<a href='javascript:location.reload();'>刷新页面</a>&nbsp;&nbsp;&nbsp;<a href='javascript:history.go(-1)'>返回</a></th>
  </tr>

  <tr>
  	<td align="center">英文描述
  	  <input type="text" name="info_en" />
  	  中文描述
  	  <input type="text" name="info_zh" />
  	  自定义组
  	  <input type="text" name="info_group" /></td>
  </tr>
  {/section name=sec2 loop=$resource/}
  <tr onmouseover="this.style.background='#FFFF66'" onmouseout="this.style.background=''">
    <td><table width="100%" border="1">
      <tr>
	  <td width="30%">
	    <input type="checkbox" name="{/$resource[sec2].our_en_name/}" id="{/$resource[sec2].our_en_name/}" value="{/$resource[sec2].our_id/}"  onclick="check('{/$resource[sec2].our_en_name/}')"/>
	    {/$resource[sec2].our_group/}</td>
        <td width="30%">{/$resource[sec2].our_zh_name/}</td>
		 <td width="30%">{/$resource[sec2].our_en_name/}</td>
		 </tr>
      <tr>
        <td colspan="4">下属操作:
		 {/foreach name=sjf_list_1 key=key11 item=item11 from=$resource[sec2].do/}
     <input id="{/$resource[sec2].our_en_name/}_{/$smarty.foreach.sjf_list_1.iteration/}" type="checkbox" onclick="check_check('{/$resource[sec2].our_en_name/}',{/$resource[sec2].do|@count/});"  name="{/$resource[sec2].our_en_name/}_list[]" value="{/$resource[sec2].do_sign.$key11/}" />{/$resource[sec2].do.$key11/}
{//foreach/}
         <input id="{/$resource[sec2].our_en_name/}_check_number" type="hidden" value="{/$resource[sec2].do|@count/}" />
        </td>
        </tr>
    </table></td>
  </tr>
  {//section/}
  <tr>
  	<td align="center"><input type="hidden" value="{/section name=sec4 loop=$resource/}{/$resource[sec4].our_en_name/}|{//section/}" name="all_resource" /><input type="submit" name="Submit" value="新增" style="background:#FF0000" /></td>
  </tr>
    
</table>
  </form> 
{//if/}
{/if $do_type == 'up'/}
<Script   language="JavaScript">   
     //验证表单
      function   check_up()   
      {       
       if   (form1.info_zh.value == "")   
          {   
              alert("请输入中文描述!");   
              form1.info_zh.focus();   
              return   (false);   
          } 
		  
	   if   ( form1.info_en.value == "")   
          {   
              alert("请输入英文描述!");   
              form1.info_en.focus();   
              return   (false);   
          } 
      }  
	   /*假使一组资源有下属操作被选中,该资源就被自动选中*/
	   function check_check(list_name,number){
	      //alert(list_name);alert(number);
		  var result = 0;
		  result = result -0;
		  for (i=1;i<=number;i++){
		      if (document.getElementById(list_name+'_'+i).checked == true){
			      result = result + 1;
			  }
		  }
		  if (result == 0){
		      document.getElementById(list_name).checked = false;
		  }else{
		       document.getElementById(list_name).checked = true;
		  }
	   }
	   
	   /*点击选中资源时,其下操作全选*/
	   function check(name){
	       num = document.getElementById(name+'_check_number').value - 0;
		   if (document.getElementById(name).checked == true){
		       do_do = true;
		   }else{
		       do_do =false;
		   }
		   
		   for (j=1;j<=num;j++){
			       document.getElementById(name+'_'+j).checked = do_do;
			}
	   }
  </Script>
 <form id="form1" name="form1" method="post" action="/acladmin/group/do_type/up/key/{/$result[0].oug_id/}" onsubmit="return check_up();">
 <table width="80%" border="1" align="center">
  <tr>
    <th>修改用户组 &nbsp;&nbsp;&nbsp;<a href='javascript:location.reload();'>刷新页面</a>&nbsp;&nbsp;&nbsp;<a href='javascript:history.go(-1)'>返回</a></th>
  </tr>
 <tr>
  	<td align="center">英文描述
  	  <input type="text" name="info_en"  value="{/$result[0].oug_en_name/}"/>
  	  中文描述
  	  <input type="text" name="info_zh" value="{/$result[0].oug_zh_name/}"/>
  	  自定义组
  	  <input type="text" name="info_group" value="{/$result[0].oug_group/}" /></td>
  </tr>
  {/section name=sec2 loop=$resource/}
  <tr onmouseover="this.style.background='#FFFF66'" onmouseout="this.style.background=''">
    <td><table width="100%" border="1">
      <tr>
	  <td width="30%">
	    <input type="checkbox" name="{/$resource[sec2].our_en_name/}" {/if $resource[sec2].now == '1'/} checked="checked" {//if/} id="{/$resource[sec2].our_en_name/}" value="{/$resource[sec2].our_id/}"  onclick="check('{/$resource[sec2].our_en_name/}')"/>
	    {/$resource[sec2].our_group/}</td>
        <td width="30%">{/$resource[sec2].our_zh_name/}</td>
		 <td width="30%">{/$resource[sec2].our_en_name/}</td>
		 </tr>
      <tr>
        <td colspan="4">下属操作:
		 {/foreach name=sjf_list_1 key=key11 item=item11 from=$resource[sec2].do/}
     <input id="{/$resource[sec2].our_en_name/}_{/$smarty.foreach.sjf_list_1.iteration/}" type="checkbox" onclick="check_check('{/$resource[sec2].our_en_name/}',{/$resource[sec2].do|@count/});" {/if $resource[sec2].checked.$key11=='1'/} checked="checked" {//if/} name="{/$resource[sec2].our_en_name/}_list[]" value="{/$resource[sec2].do_sign.$key11/}" />{/$resource[sec2].do.$key11/}
{//foreach/}
         <input id="{/$resource[sec2].our_en_name/}_check_number" type="hidden" value="{/$resource[sec2].do|@count/}" />
        </td>
        </tr>
    </table></td>
  </tr>
  {//section/}
  <tr>
  	<td align="center"><input type="hidden" value="{/section name=sec4 loop=$resource/}{/$resource[sec4].our_en_name/}|{//section/}" name="all_resource" /><input type="submit" name="Submit" value="修改" style="background:#FF0000" /></td>
  </tr>
  
</table>
  </form>   
{//if/}

</div>
<!-- 以下底部信息不要改-->
{/include file=$this->bottom_file /}